package com.order_system.controller;


import com.order_system.constants.Code;
import com.order_system.entity.PayMode;
import com.order_system.entity.ResModel;
import com.order_system.service.PayModeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 李阳
 * @since 2023-01-06
 */
@RestController
@RequestMapping("/api/pay/mode")
public class PayModeController {

    @Autowired
    private PayModeService payModeService;

    /**
     * 查询支付类型
     *
     * @return
     */
    @GetMapping("/list")
    public ResModel list() {
        return ResModel.success(Code.SUCCESS, payModeService.list());
    }


    @GetMapping("/{modeId}")
    public PayMode selectById(@PathVariable Integer modeId) {
        return payModeService.selectById(modeId);
    }


}